function Loading({ children, loaded = true}) {
    if (!Array.isArray(children))
        return children;

    let skeletons = children.filter(child => child.type === LoadingSkeleton);
    let contents = children.filter(child => child.type === LoadingContent);
    return loaded ? contents : skeletons;
}

function LoadingSkeleton({ children }) {
  return children;
}

function LoadingContent({ children }) {
  return children;
}

export {LoadingContent, Loading, LoadingSkeleton};